package com.qianli.cashmama.trade.common.enums;

/**
 * Created with IntelliJ IDEA.
 * User: sm
 * Date: 2017/7/22
 * Time: 上午11:51
 */
public enum TradeClientTypeEnum {
    INIT(0, "初始化"),
    ANDROID(1, "安卓"),
    IOS(2, "苹果"),
    H_5(3, "H_5");

    private int type;
    private String desc;

    TradeClientTypeEnum(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public int getType() {
        return type;
    }

    public TradeClientTypeEnum setType(int type) {
        this.type = type;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public TradeClientTypeEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static TradeClientTypeEnum getByType(int type) {
        TradeClientTypeEnum tradeClientTypeEnum = null;
        for (TradeClientTypeEnum typeEnum : TradeClientTypeEnum.values()) {
            if (typeEnum.getType() == type) {
                tradeClientTypeEnum = typeEnum;
            }
        }

        return tradeClientTypeEnum;
    }
}
